<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/3.0.5/vue.global.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>

<body>
    <div id="app" class="demo">
        <hr>
        <div>{{msg}}</div>
        <hr>

        <button @click="getGoods">获取商品</button>
    </div>
</body>
<script>

    //免费api网址：https://api.uomg.com/
    let api = "https://api.uomg.com/api/rand.qinghua?format=json";
    api = "https://api.oioweb.cn/api/qq/info?";

    const HelloVueApp = {
        data() {
            return {
                msg: 'hello world'
            }
        },
        methods: {
            getGoods() {
                axios.get(api, { params: { 'qq': '907640911' } })
                .then(response => {
                    this.msg = response
                }).catch(e => {
                    console.log(e);
                })
            }
        }
    }

    Vue.createApp(HelloVueApp).mount('#app')
</script>

</html>